package com.zuoye.entity;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/15  18:13
 * @Copyright
 */
public abstract class Account {
    public String cardNo;
    public String password;
    public double balance;

    public Account() {

    }

    public Account(String cardNo, String password, double balance) {
        this.cardNo = cardNo;
        this.password = password;
        this.balance = balance;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double save(double money) {

        double b = this.balance;
        b += money;

        System.out.println("当前余额为：" +b + "元");
        this.balance = b;

        return b;
    }


    public abstract double deposit(double money, String number, String password);
}
